package com.dataneway.hybridservice;

import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.dataneway.hybridservice.server.SocketServerStarter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;

import static com.dataneway.hybridservice.ServiceConst.BASE_PACKAGE_NAME_CONST;

/**
 * @author P-JIANGH
 */
@SpringBootApplication
@EnableMethodCache(basePackages = BASE_PACKAGE_NAME_CONST)
@EnableCreateCacheAnnotation
public class HybridServicesApplication implements CommandLineRunner {

	@Autowired
	private SocketServerStarter serverStarter;

	public static void main(String[] args) {
		SpringApplication.run(HybridServicesApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		serverStarter.start();
	}

}
